import React, { Component } from 'react'
import {
  View,
  Text,
  TouchableOpacity,
  StyleSheet,
  Platform,
  ScrollView,
  Image,
  TouchableHighlight,
  TextInput,
  Modal
} from 'react-native'

class SearchModal extends Component{
  constructor(props) {
    super(props);
    this.state = {
      modalVisible: false,
    }
  }

  componentWillReceiveProps(nextProps) {
    const {openModal} = nextProps
    this.setShareVisible(openModal)
  }

  setShareVisible(visible) {
    this.setState({modalVisible: visible});
  }

  render(){
    return(
      <Modal
        animationType={"none"}
        transparent={true}
        visible={this.state.modalVisible}
        onRequestClose={() => {console.log("Modal has been closed.");}}
      >
        <View style={styles.container}>
          <Text>123123</Text>
        </View>
      </Modal>
    )
  }
}

const styles = StyleSheet.create({
  container:{
    flex:1,
    backgroundColor:'#fff',
    marginTop: Platform.OS === 'ios' ? 55 : 35,
  }
})

export default SearchModal;